function OS_SelectDialog(game,scene,winres,params)
{
	this.$super=OS_Dialog;
	this.$super(game,scene,winres,params);
	delete this.$super;
	
	var text=params.text;
	var lines=null;
	var linePointer=0;
	var duration=1000;
	
	var lineOffset=0;
	if (!!text) lineOffset=1;
	var lineS=0;
	var lineE=Math.floor((this.getHeight()-this.getPaddingT()*2-lineOffset*this.getLineHeight())/this.getLineHeight())-1;
	
	var instance=this;
	
	this.updateContent=function()
	{
		var nowTime=(new Date()).getTime();
		var alpha=Math.sin(Math.PI*(nowTime%duration/duration))*0.2+0.2;
		var background="rgba(255,255,255,"+alpha+")";
		
		if (text!=null)
		{
			var drawing={
				type:"text",
				line:0,
				text:text,
				textLen:text.length,
				background:null
			};
			this.drawList.push(drawing);
		}
		if (this.getActiveKey()=="down")
		{
			linePointer=(linePointer+1)%params.options.length;
		}
		if (this.getActiveKey()=="up")
		{
			linePointer=(linePointer-1+params.options.length)%params.options.length;
		}
		if (this.getActiveKey()=="esc")
		{
			game.status.V.put(params.key,"ESC");
			this.close();
		}
		if (linePointer<lineS) {lineS=linePointer;lineE=lineS+1;}
		if (linePointer>lineE) {lineE=linePointer;lineS=lineE-1;}
		for (var i=lineS;i<=lineE&&!!params.options[i];i++)
		{
			var drawing={
				type:"text",
				line:i-lineS+lineOffset,
				text:params.options[i].text,
				textLen:params.options[i].text.length,
				background:linePointer==i?background:null,
				disable:params.options[i].disable
			};
			this.drawList.push(drawing);
		}
		if (this.getActiveKey()=="enter" || this.getActiveKey()=="space")
		{
			if (linePointer<params.options.length && !params.options[linePointer].disable)
			{
				game.status.V.put(params.key,params.options[linePointer].value);
				this.close();
			}
		}
	}
}
